#ifndef TYPESANDDEFINITIONS_H
#define TYPESANDDEFINITIONS_H

#include "includes/QtIncludes.h"

//Sistemas de Coordenadas
/*---------------------------------------------------------------------------------------------------*/
typedef struct JpegImageInfo {
    QString Directory, ImagePrefix, ImageSequence, FormatType, CameraId;

    //default
    JpegImageInfo(QString _Directory, QString _ImageSeq, QString _CameraId, QString _Format)
    {
        Directory = _Directory;
        ImageSequence = _ImageSeq;
        CameraId      = _CameraId;
        FormatType   =  _Format;
    }

    JpegImageInfo()
    {
        Directory = "";
        ImageSequence = "";
        CameraId      = "";
        FormatType   = "";
    }

    std::string getFullPath ()
    {
        QString FullPath = this->Directory + this->ImageSequence + this->CameraId + this->FormatType;
        return FullPath.toStdString();
    }
} ImagePath;


typedef struct RetCoordSystemDef {
    double Xaxis, Yaxis, Zaxis;
    //Default
    RetCoordSystemDef()
    {
        this->Xaxis = 0;
        this->Yaxis = 0;
        this->Zaxis = 0;
    }
} xyzPoint;

typedef struct CartAngle {
    double AngleDegree, AngleRad;
    //Default
    CartAngle()
    {
        AngleDegree = 0;
        AngleRad = 0;
    }

    CartAngle(int AngleType = 0, double AngleValue = 0)
    { //AngleType = 0, Degree; AngleType = 1, Rad)
        if (AngleType == 0){
            this->setAngleDeg(AngleValue);
        }
        else {
            this->setAngleRad(AngleValue);
        }

    }

    void setAngleRad(double setRad)
    {
        this->AngleRad = setRad;
        this->AngleDegree = (180*this->AngleRad)/(M_PI);
    }

    void setAngleDeg(double setDegree)
    {
        this->AngleDegree = setDegree;
        this->AngleRad = (M_PI*this->AngleDegree)/180;
    }
} Angle;



//Pontos chave
/*---------------------------------------------------------------------------------------------------*/
typedef struct KeyPointDef {
    int CodID;
    xyzPoint CartCoordinates;
} PontoChave;
/*---------------------------------------------------------------------------------------------------*/

//Posição (Localização + ângulo de postura) - Coordenadas cartesianas
/*---------------------------------------------------------------------------------------------------*/
typedef struct Pose {
    xyzPoint CartCoordinates;
    Angle HeadAngle;
} Postura;
/*---------------------------------------------------------------------------------------------------*/

#endif // TYPESANDDEFINITIONS_H
